import { generateReadlineResults } from '../../src/redline/util';
import { CodeScanResult,RedlineResult } from '../../src/redline';
import {expect} from 'chai'


describe('generateReadlineResults', () => {
  it('should return an array of RedlineResult objects with correct values', () => {
    const mockCodeScanResult: CodeScanResult = {
      issue: {
        total: 3,
        blocker: 1,
        critical: 1,
        major: 1
      },
      reportLocalPath: 'mockReportLocalPath'
    };

    const expectedResults: RedlineResult[] = [
      { key: 'Total', title: 'issue', style: 'text-danger', value: 3 },
      { key: 'Blocker', title: 'issue', style: 'text-danger', value: 1 },
      { key: 'Critical', title: 'issue', style: 'text-danger', value: 1 },
      { key: 'Major', title: 'issue', style: 'text-danger', value: 1 }
    ];

    const results = generateReadlineResults(mockCodeScanResult);

    expect(results).to.deep.equal(expectedResults);
  });
});
